<!--
* description: 提交组
* author: tfy
* createdDate: 2019-10-18
-->
<template>
<div class="filter-container filter-button filter-button-bottom-abosulte">
    <el-button
      v-for="(comp) in formSubmitButton"
      :icon="getIcon(comp)"
      :size="comp.size"
      :type="comp.type"
      :text="comp.text"
      :key="comp.compKey"
      @click="comp.clickEvent"
      :ref="comp.compKey"
      :class="formSubmitButtonClass"
      :style="comp.isShow?'display:block':'display:none'"
    >{{comp.text}}</el-button>
</div>
</template>
<script>
export default {
  name: "crmGroupSubmit",
  props: {
    formSubmitButton: {
      type: Array,
      default: function() {
        return [];
      }
    },
    text:{
      type:String,
      default: function() {
        return '';
      }
    }
  },
  created(){
    var that =this
  },
  data() {
    return {
       formSubmitButtonClass:'button',
       formSubmitButton: this.formSubmitButton
    };
  },
  methods:{
     getIcon(comp) {
        var text = comp.text;
     if (text.indexOf("新增") != -1) {
        comp.type = "";
        return "iconfont icon-newlyAdded";
      }
      if (text.indexOf("导出") != -1) {
        comp.type = "";
        return "iconfont icon-export";
      }
      if (text.indexOf("导入") != -1) {
        comp.type = "";
        return "el-icon-goods";
      }
      if (text.indexOf("进度") != -1) {
        comp.type = "";
        return "iconfont icon-carProgress";
      }
      if (text.indexOf("驳回") != -1) {
        comp.type = "";
        return "iconfont icon-reject";
      }
       if (text.indexOf("拒绝") != -1) {
        comp.type = "";
        return "iconfont icon-refuse";
      }
       if (text.indexOf("打印") != -1) {
        comp.type = "";
        return "iconfont icon-printing";
      }
      if (text.indexOf("短信") != -1) {
        comp.type = "";
        return "iconfont icon-SMSsending";
      }
      if (text.indexOf("撤销") != -1) {
        comp.type = "";
        return "iconfont icon-cancelApplicationForm";
      }
      if (text.indexOf("通过") != -1) {
        comp.type = "";
        return "iconfont icon-adopt";
      }
      if (text.indexOf("提交") != -1) {
        comp.type = "";
        return "iconfont icon-submissionUp";
      }
       if (text.indexOf("修改") != -1) {
        comp.type = "";
        return "iconfont icon-modifyCustomerProfile";
      }
 if (text.indexOf("保存") != -1) {
        comp.type = "primary";
        return "iconfont  icon-preservation";
      }
      if (text.indexOf("暂存") != -1) {
        comp.type = "";
        return "iconfont icon-temporaryStorage";
      }
      if (text.indexOf("确认") != -1) {
        comp.type = "";
        return "iconfont  icon-confirm";
      }
      if (text.indexOf("回访") != -1) {
        comp.type = "";
        return "iconfont icon-returnVisit";
      }
      if (text.indexOf("申请") != -1) {
        comp.type = "";
        return "iconfont icon-applicationComplaint";
      }

    }
  }
  
};
</script>
